package com.linkdood.app.dto;

import com.linkdood.app.constants.ErrorCode;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import java.util.List;

/**
 * 消息对象
 *
 * @author hycao
 */
@Data
public class NoticeMessageDTO {

    @NotEmpty(message = ErrorCode.ERROR_INVALID_PARAM)
    private String title;

    @NotEmpty(message = ErrorCode.ERROR_INVALID_PARAM)
    private String content;

    /**
     * 0 - 普通消息
     * 1 - 带按钮的交互消息
     */
    private Integer type;

    private String leftButtonName;

    private String rightButtonName;

    private List<ReceiverUser> users;

    private List<Receiver> groups;

    private Organization organizations;

    private List<AttachmentDTO> attachments;

    private List<AttachmentDTO> images;

    @Data
    public static class ReceiverUser {
        private String sourceId ;
        private String name;
    }

    @Data
    public static class Receiver {
        private String id;
        private String name;
    }

    @Data
    public static class Organization {
        private List<Receiver> checkedOrgs;
        private List<Receiver> uncheckedOrgs;
        private List<ReceiverUser> checkedUsers;
        private List<ReceiverUser> uncheckedUsers;
    }
}
